#include "header.h"
#include "mtime.h"
#include "extern.h"

time_t time_now (void){
	starttime = time (NULL);
	return (starttime);
}

char* time_get_ascii (time_t Time)
{

 char *suptime = malloc (sizeof (char) * 32);
 struct tm *tmm = NULL;

	tmm = gmtime (&Time);
		if (tmm == NULL){
			printf ("gmtime error\n"); /*<-----------------------------------------*/
		}
	strftime (suptime, sizeof (suptime), "%X", tmm);

 return (suptime);
}

void time_print_current (time_t Time)
{

 char suptime[32];
 struct tm *tmm = NULL;

	tmm = gmtime (&Time);
		if (tmm == NULL){
			printf ("gmtime error\n"); /*<-----------------------------------------*/
		}
	strftime (suptime, sizeof (suptime), "%X", tmm);
	printf ("%s\n", suptime);
}

